package com.woniuxy.ptapp.client;

import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.fasterxml.jackson.core.JsonProcessingException;
import com.woniuxy.commons.util.Result;
import com.woniuxy.ptapp.client.param.FileUploadDto;
import com.woniuxy.ptapp.client.param.ShowAllAppealDto;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.stereotype.Component;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.multipart.MultipartFile;

import java.io.IOException;
import java.io.UnsupportedEncodingException;
import java.math.BigDecimal;
import java.util.List;

@Component
@Api(tags = "申诉接口")
@FeignClient(value = "yoga-pt",path="/pt",contextId ="AppealClient")
public interface AppealClient {
    @ApiOperation("提交申诉(学员)")
    @GetMapping("/startAppeal")
    public Result startAppeal(@RequestParam Integer complaintOrderClassesId,@RequestParam String complaintReason,@RequestParam String complaintVoucher);


    @ApiOperation("管理员审核(管理员)")
    @GetMapping("/adminAudit")
    public Result adminAudit(@RequestParam Integer id,@RequestParam Integer dealReason,@RequestParam BigDecimal punishMoney) throws UnsupportedEncodingException, JsonProcessingException;

    @ApiOperation("图片上传方法(所有人)")
    @PostMapping("/upload")
    public Result<List<FileUploadDto>> uploadFoodVariety(@RequestBody MultipartFile[] upload) throws IOException;

    @ApiOperation("展示所有申诉记录(管理员)")
    @GetMapping("/AllAppeal")
    public Result<Page<ShowAllAppealDto>> AllAppeal(@RequestParam Integer current, @RequestParam Integer size);

}
